import NetAdapter from "../../adpapter/NetAdapter";
import { AlertManager } from "../../alert/AlertManager";
import { MVC } from "../../framework/MVC";
import GlobalData from "../../GlobalData";
import DeviceManager from "../../manager/DeviceManager";
import { GameVoManager } from "../../manager/GameVoManager";
import { Util } from "../../utils/Util";
const { ccclass, property } = cc._decorator;

@ccclass
export default class ShimingFakeView extends MVC.BaseView {
    protected changeListener(enable: boolean): void {
    }

    @property(cc.Node)
    maskNode: cc.Node = null;

    onClickShiming() {
        this.maskNode.active = true;
        DeviceManager.inst.zfbOpenAuthScheme("", "", 
            () => {
            this.maskNode.active = false;
            NetAdapter.zfbAuthentication({})
            .then(res => {
                AlertManager.showNormalTips("实名认证成功");
            })
            GlobalData.inst.zfbAuthentication= 1;
            this.onClose();
        }, () => {
            AlertManager.showNormalTips("实名认证失败");
            this.maskNode.active = false;
        })
    }

}